package com.zmn.oms.common.constant;

/**
 * 类描述：redis key 常量维护
 * @author heciqi
 * @date 2020/7/13 16:02
 */
public class RedisKeyConsts {
    /**
     * 特殊优惠券-券码
     */
    public static String DISCOUNT_SPECIAL_ITEMCODE_KEY = "oms:discount:itemcode:%s";

    /**
     * 特殊优惠券-优惠折扣金额
     */
    public static String DISCOUNT_SPECIAL_DISCOUNTAMOUNT_KEY = "oms:discount:discountamount:%s";

    /**
     * 特殊优惠券-批次id
     */
    public static String DISCOUNT_SPECIAL_BATCHID_KEY = "oms:discount:batchid:%s";

    /**
     * 工程师申请优惠标示-订单维度 订单号_工程师Id
     */
    public static String MASTER_APPLY_DISCOUNT_KEY = "oms:discount:discount:apply:%s_%s";

    /**
     * 工程师申请优惠审核中标示
     */
    public static String MASTER_APPLY_DISCOUNT_REVIEWING_KEY = "oms:discount:discount:review:%s_%s";

    /**
     * 用户是否确认过报价
     */
    public static String USER_HAVE_CONFIRM_QUOTATION_KEY = "oms:quotation:confirm:%s";

    /**
     * 标识是否存在未同步数据 by lianghailong
     */
    public static String INS_SYNC_TIMEOUT_FLAG = "oms:insOrder:syncTimeoutFlag";

    /**
     * 按单保险完成消息去重 by lianghailong
     */
    public static String INS_MQ_MSG_KEY = "oms:insOrder:complete:%s";

    /**
     * 关闭保险同步功能标识 by lianghailong
     */
    public static String INS_DISABLE_SYNC_KEY = "oms:insOrder:disableSync";

    /**
     * 用于过滤师傅因手抖等原因在极短时间内重复操作两次领单或上门的问题 2021.09.08 by lhl
     */
    public static String INS_ORDER_DUPLICATE_TAKE_OR_VISIT_KEY = "oms:insOrder:duplicate:%s%s";

    /**
     * 购买保险失败的师傅，用于发送保险失败消息提醒 by lianghailong
     */
    public static String INS_MASTER_INSURE_FAILED_KEY = "oms:insOrder:masterFailed:%s";

    /**
     * 发送报价模板redis key
     */
    public static final String WECHAT_SEND_QUOTATION_TEMPLATE_KEY = "oms:wechat:send_quotation_template:%s_%s";

    /**
     * 58到家直约渠道token
     */
    public static final String DJ58_REDIS_KEY_ACCESS_TOKEN = "oms:channel:58dj:token";

    /**
     * 58到家同直约步接收订单消息
     */
    public static final String DJ58_REDIS_KEY_ACCPET_ORDER = "oms:channel:58dj:accept_order";

    /**
     * 有赞渠道token
     */
    public static final String YOUZAN_REDIS_KEY_TOKEN = "oms:channel:youzan:token";

    /**
     * 头条渠道线索
     */
    public static final String TOUTIAO_REDIS_KEY_CLUE = "oms:channel:toutiao:chl.%s:cid.%s";

    /**
     * 天猫渠道线索Redis key, 使用redis过滤重复新单消息。
     *  天猫新单消息有可能在极短的时间（小于1秒）内，重复发送两次，导致录单重复
     */
    public static final String TMALL_REDIS_KEY_CLUE_ID = "oms:channel:tmall:%s";

    /**
     * 渠道线索ID
     */
    public static final String CHANNEL_CLUE_ID = "oms:channel:chl.%s:cid.%s";
    /**
     * 渠道线索ID过期时间
     */
    public static final int CHANNEL_CLUE_ID_EXPIRE_SECONDS = 5 * 60;
    /**
     * 渠道接口线索ID
     */
    public static final String CHAN_FACADE_CLUE_ID = "oms:chan:facade.%s:cid.%s";
    /**
     * 渠道ID线索ID
     */
    public static final String CHAN_CHANNEL_CLUE_ID = "oms:chan:channel.%s:cid.%s";
    /**
     * 渠道接口线索ID过期时间（24小时）
     */
    public static final int CHAN_CLUE_ID_EXPIRE_SECONDS = 60 * 60 * 24;
    /**
     * 渠道门户锁
     */
    public static final String CHANNEL_FACADE_LOCK_KEY = "oms:chan:lock:%s:%s";

    /**
     * 渠道第三方支付二维码链接
     */
    public static final String CHANNEL_PAY_QRCODE_ID = "oms:channel:pay_qrcode:order.%s";

    /**
     * 渠道第三方支付二维码链接信息
     */
    public static final String CHANNEL_PAY_LINK_INFO = "oms:channel:pay_link_info:order.%s";
    /**
     * 渠道第三方支付二维码链接过期时间
     */
    public static final int CHANNEL_PAY_QRCODE_ID_EXPIRE_SECONDS = 1 * 60;

    /**
     * 京东华帝token信息redis存储key
     */
    public static final String JD_HUADI_TOKEN_REDIS_KEY = "oms:channel:huadi:token";

    /**
     * 58独家优惠-挂机空调清洗计量保存
     */
    public static final String DUJIA_DISCOUNT_REDIS_KEY = "oms:channel:dujia:discount:1511.10834:%s";

    /**
     * 等待重新自动派单队列标识
     */
    public static final String WAIT_AUTO_DISTRIBUTE_ORDER = "oms:distribute:wait_auto_distribute_order_%d";

    /**
     * 跨网格派单等待标识
     */
    public static final String ACROSS_DISTRIBUTE_WAIT_TIME_ORDER = "oms:distribute:across_distribute_wait_time_order_%d";

    /**
     * 跨网格派单等待次数
     */
    public static final String ACROSS_DISTRIBUTE_WAIT_COUNT_ORDER = "oms:distribute:across_distribute_wait_count_order_%d";

    /**
     * 工程师修改产品次数
     */
    public final static String MASTER_MODIFY_PRODUCT_COUNT_KEY = "oms:master:master_modify_product_count_%d";

    /**
     * 工程师修改预约时间次数
     */
    public final static String MASTER_MODIFY_DUTY_TIME_COUNT_KEY = "oms:master:master_modify_dutytime_count_%d_%d_%s";

    /**
     * 厂商单批量导入批次ID 供查询
     */
    public final static String ORDER_UPLOAD_KEY = "oms:order:upload:_%s";

    /**
     * 雅管家渠道订单支付次数
     */
    public final static String YAJULE_CHANNEL_PAY_KEY = "oms:channel:yajule:order_pay_%d";

    /**
     * 百度智能小程序渠道token
     */
    public final static String BAIDU_APP_TOKEN_REDIS_KEY = "oms:channel:baidu_app:token";

    /**
     * oms服务完成标志
     */
    public final static String ORDER_SERVICE_COMPLETE_KEY = "oms:order:servicecomplete:_%s";

    /**
     * oms完成码
     */
    public final static String ORDER_COMPLETE_CODE_KEY = "oms:order:complete_code:%s";

    /**
     * 云丁鹿客渠道订单资料数据
     */
    public final static String YUNDING_LOCK_DATA_REDIS_KEY = "oms:channel:yunding_lock:order_%d";

    /**
     * 易聊平台推单数据
     */
    public final static String EASYLIAO_PULL_ORDER_REDIS_KEY = "oms:channel:easyliao:order_%s";

    /**
     * 易聊平台发送短信数据
     */
    public final static String EASYLIAO_SEND_SMS_MESSAGE_KEY = "oms:channel:easyliao:sms_message_%s";

    /**
     * 百度场景id,用户百度消息发送
     */
    public final static String BAIDU_SCENEIDS_REDIS_KEY = "oms:message:baidu:order_%s";

    /**
     * 顺丰平台推单数据
     */
    public final static String SF_PULL_ORDER_REDIS_KEY = "oms:channel:shunfeng:order_%s";

    /**
     * 京东到家渠道token数据
     */
    public final static String JDDJ_TOKEN_REDIS_KEY = "oms:channel:jddj:token";

    /**
     * 京东到家渠道订单核销码数据
     */
    public final static String JDDJ_VCODE_REDIS_KEY = "oms:channel:jddj:vcode:order_%d";

    /**
     * 国美管家渠道token数据
     */
    public final static String GOME_GJ_TOKEN_REDIS_KEY = "oms:channel:gome_gj:token";

    /**
     * 国美管家渠道支付数据
     */
    public final static String GOME_GJ_ORDER_PAY_REDIS_KEY = "oms:channel:gome_gj:pay:order_%d";

    /**
     * 国美管家渠道订单数据
     */
    public final static String GOME_GJ_ORDER_CREATE_REDIS_KEY = "oms:channel:gome_gj:create:order_%s";

    /**
     * 自动分单直营服务商-日期-城市ID-直营服务商ID-非直营服务商ID
     */
    public static final String AUTO_ASSIGN_DIRECT_DATE_CITY_KEY = "oms:assign:auto_assign_direct_%s_city_%d_%d_%d";

    /**
     * 自动分单非直营服务商-日期-城市ID-直营服务商ID-非直营服务商ID
     */
    public static final String AUTO_ASSIGN_NOT_DIRECT_DATE_CITY_KEY = "oms:assign:auto_assign_not_direct_%s_city_%d_%d_%d";

    /**
     * 子公司师傅计价器使用率
     */
    public final static String COMPANY_MASTER_QUOTATION_RATE_KEY = "oms:company:master:quotation:rate:orgThrId_%s";

    /**
     * 全国师傅计价器使用率
     */
    public final static String ALL_MASTER_QUOTATION_RATE_KEY = "oms:company:master:quotation:rate:all";

    /**
     * 自动流转锁
     */
    public static final String AUTO_FLOW_LOCK = "oms:autoflow:lock_%d";

    /**
     * 自动流转防重复消费
     */
    public static final String AUTO_FLOW_REPEAT_CONSUME = "oms:autoflow:repeat:consume:%d";

    /**
     * 预分单服务商
     */
    public static final String CHECK_MANAGE_COMPANY_KEY = "oms:check:manage_company_%s";

    /**
     * 服务商不满足原因
     */
    public static final String CHECK_MANAGE_COMPANY_REASON_KEY = "oms:check:manage_company_reason_%s";

    /**
     * 搜狗渠道线索数据
     */
    public final static String SOGOU_CLUE_REDIS_KEY = "oms:channel:sogou:clue_%s";

    /**
     * 天猫勤鸽自营渠道订单Redis key, 使用redis过滤重复新单消息以及保存处理状态
     */
    public static final String TMALL_QINGE_ORDER_STATUS_REDIS_KEY = "oms:channel:tmall_qinge:order_status_%s";

    /**
     * 天猫勤鸽自营渠道订单列表Redis key
     */
    public static final String TMALL_QINGE_ORDER_LIST_REDIS_KEY = "oms:channel:tmall_qinge:order_list";

    /**
     * 口碑渠道线索数据
     */
    public final static String KOUBEI_CLUE_REDIS_KEY = "oms:channel:koubei:clue_%s";

    /**
     * 自动派单首轮
     */
    public final static String AUTO_DISTRIBUTE_FIRST_MASTER_KEY = "oms:auto:distribute:first_master_%d";

    /**
     * 退款单操作
     */
    public static String ORDER_OPERATE_REFUND_KEY = "oms:operate:refund:%s";

    /**
     * 师傅当天抢单数量
     */
    public static String GRAB_ORDER_COUNT_KEY = "oms:grab:order_count_%s_%s";

    /**
     * 抢单消费存根
     */
    public static final String GRAB_CONSUME_ORDER_KEY = "oms:grab:consume:order_%s";

    /**
     * 无网格抢单消费存根
     */
    public static final String GRAB_CONSUME_NON_GRID_ORDER_KEY = "oms:grab:consume:non_grid_order_%s";

    /**
     * 算账锁
     */
    public static final String AUTO_ACCOUNT_LOCK_KEY = "oms:auto:account:order_%s";

    /**
     * 渠道订单配置-请求锁
     */
    public static final String ORDER_CHANNEL_CONFIG_LOCK_KEY = "oms:order_channel_config_lock:%s";

    /**
     * oms 审批code
     */
    public final static String ORDER_REVIEW_CODE_KEY = "oms:order:review_code:%s";

    /**
     * 服务验收发送微信模板消息key
     */
    //public static final String ORDER_ACCEPTANCE_WECHAT_MESSAGE_KEY = "oms:order:acceptance:wechat_message_%s";

    /**
     * oms 派单超时检查
     */
    public static final String ORDER_DISTRIBUTE_TIMEOUT_CHECK_KEY = "oms:order:distribute_timeout_check:order_%s_%s";

    /**
     * oms 处理派单超时
     */
    public static final String ORDER_DEAL_DISTRIBUTE_TIMEOUT_KEY = "oms:order:deal_distribute_timeout:order_%s";

    /**
     * oms 是否取消过订单
     */
    public static final String ORDER_CANCELED_REFUND_KEY = "oms:order:canceled:order_%s";

    /**
     * oms 工程师工程师半小时内十条短信限制
     */
    public static final String ORDER_MASTERID_LIMIT_KEY = "oms:masterid:limit:30min:%s";

    /**
     * oms 一分钟内相同短信验证码存活时间
     */
    public static final String ORDER_CAPTCHA_SEND_LIMIT1_KEY = "oms:captcha:alive:1min:%s";

    /**
     * oms 15分钟内短信验证码存活时间
     */
    public static final String ORDER_CAPTCHA_SEND_LIMIT15_KEY = "oms:captcha:alive:15min:%s";

    /**
     * oms 订单加手机号 每月2条确认消息确定 工程师ID_手机号
     */
    public static final String ORDER_PHONE_LIMIT_KEY = "oms:order:mobile:limit:30day:%s_%s";

    /**
     * oms 自然月发送确认类短信次数，每个手机号只允许2次
     */
    public static final String ORDER_CONFIRM_PHONE_LIMIT_KEY = "oms:order:mobile:confirm:limit:30day:%s";

    /**
     * oms 订单加手机号 每月2条确认消息确定 工单号
     */
    public static final String ORDER_SAME_ORDER_PHONE_LIMIT_KEY = "oms:order:mobile:limit:same30day:%s_%s";

    /**
     * mapp 每个手机号每月只能操作两次同意维修
     */
    public static final String ORDER_AGREE_REPAIR_TIME = "oms:order:mobile:repair:limit:month:%s";

    /**
     * 缓存重复的未成单数据
     */
    public static final String ORDER_UNAVAILABLE_SERVICE_KEY = "oms:order:unavailable:service:%s_%s";


    /**
     * 小号解绑并发问题
     */
    public static final String ORDER_XNO_UNBIND_KEY = "oms:order:xno:unbind:work:%s";

    /**
     * 发送消息并发限制
     */
    public static final String ORDER_LOCK_MESSAGE_NODE_KEY = "oms:lock:message:%s-%s";

    /**
     * 抢单配置缓存
     */
    public static final String OMS_CONF_DISTRIBUTE_ROBORDERCONFIG = "oms:conf:distribute:rob:%s";

    /**
     * 缓存渠道订单配置
     */
    public static final String ORDER_CHANNEL_CONFIG_KEY = "oms:conf:channel:%s";

    /**
     * 缓存订单服务商改派次数（月）
     */
    public static final String ORDER_SERVICE_COMPANY_REDISTRIBUTE_COUNT_KEY = "oms:redistribute:servicecompany:count:%s";

    /**
     * 缓存订单服务商改派次数（天）
     */
    public static final String ORDER_SERVICE_COMPANY_REDISTRIBUTE_COUNT_DAY_KEY = "oms:redistribute:service:company:day:count:%s";

    /**
     * 缓存工程师发起协商转单次数（天）
     */
    public static final String MASTER_NEGOTIATED_TRANSFER_ORDER_COUNT_KEY = "oms:redistribute:master:negotiated:transfer:order:count:%s";

    /**
     * 小号解绑/绑定缓存工单详情
     */
    public static final String XNO_BIND_ORDER_DETAIL = "oms:order:xno:order:detail:%s";

    /**
     * 小号绑定/解绑缓存工单信息
     */
    public static final String XNO_BIND_ORDER_WORK = "oms:order:xno:order:work:%s_%s";

    /**
     * 小号绑定/解绑缓存区号
     */
    public static final String XNO_BIND_ORDER_AREA_NUM = "oms:order:xno:order:area:%s";

    /**
     * 小号绑定/解绑缓存绑定手机号
     */
    public static final String XNO_BIND_ORDER_TELEPHONE = "oms:order:xno:order:bindtelephone:%s";

    /**
     * 上传数据订单列表
     */
    public static final String OMS_UPLOAD_IASC_ID_LIST_KEY = "oms:upload:iasc:id_%s";

    /**
     * 发起改派申请并发限制
     */
    public static final String OMS_REDISTRIBUTE_APPLY_SAVE_KEY = "oms:redistribute:apply:save:orderId:%s";

    /**
     * 缓存跟单队列消息
     */
    public static final String ORDER_TRACK_MQ_MESSAGE_KEY = "oms:track:mq:message:%s_%s";
    /**
     * 无网格抢单分布式所
     */
    public static final String OMS_NON_GRID_GRAB_ORDER_KEY = "oms:grab:nongrid:%s";

    /**
     * 确认墙面报价
     */
    public static final String OMS_CONFIRM_WALL_QUOTATION = "oms:confirm:wall:quotation:work:%s";

    /**
     * 图片轮播，当前图片
     */
    public static final String ORDER_MASTER_NOTICE_HISTORY_CURRENT = "oms:order:master:notice:%s";
}
